<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@head>
<link rel="stylesheet" href="/misc/app/css/product_list.css"/>
</@head>

<@body>
<script src="/misc/app/js/lgsBills_item.js"></script>
</@body>

<@layout_default>
<div class="box">
    <div class="box-header with-border">
        <span class="pull-right text-muted">共 ${itemList.resultTotal} 条记录</span>
        <input type="hidden" id="resultTotal_hidden" value="${itemList.resultTotal}" />
        <form class="form-inline" action="/lgsBills/item" name="queryForm">

            <input type="hidden" id="billId" value="${billId!}" name="billId" />
        	<div class="input-group">
                <div class="input-group-addon">批次号</div>
                <input type="text" class="form-control" style="width: 180px" name="batchNub" value="${batchNub!}" placeholder="批次号"/>
            </div>
        	<div class="input-group">
                <div class="input-group-addon">箱码</div>
                <input type="text" class="form-control" style="width: 180px" name="qrcodeBoxId" value="${qrcodeBoxId!}" placeholder="箱码"/>
            </div>
        	<div class="input-group">
                <div class="input-group-addon">瓶码</div>
                <input type="text" class="form-control" style="width: 180px" name="qrcodeBottleId" value="${qrcodeBottleId!}" placeholder="瓶码"/>
            </div>
            
			<button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>
	        <button type="button" id="search_reset" class="btn btn-warning"><i class="fa"></i> 重置</button>
            
        </form>
        
    </div>

    <!-- /.box-header -->
    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th>ID</th>
                <th style="width:200px;">产品名称</th>
                <th>批次号</th>
                <th>箱码</th>
                <#--<th>瓶码</th>-->
                <th>扫码地点</th>
                <th>收/发货对象</th>
                <th>操作时间</th>
                <th>操作人</th>
                <th>操作</th>
            </tr>
            
            <#list itemList.result as item>
                <tr>
                    <td>${item.id!}</td>
                    <td>${item.productName!}</td>
                    <td>${item.batchNub!}</td>
                    <td>${item.qrcodeBoxId!}</td>
                    <#--<td>${item.qrcodeBottleId!}</td>-->
                    <td>${item.depotName!}</td>
                    <td>
                    	<#if item.nodeType?exists>
                    		<#if item.nodeType == 1>${item.toAddress!}</#if><!--显示收货地点-->
                    		<#if item.nodeType == 2>${item.fromAddress!}</#if><!--显示发货地点-->
                    	</#if>
                    </td>
                    <td>${item.scanTime?number_to_datetime}</td>
                    <td>${item.pdaUserName!}</td>
                    <td><button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#bot_detail"
                                data-qrcodeboxId="${item.qrcodeBoxId!}" data-qrcompanyid="${item.companyId!}">查看</button></td>
                </tr>
            </#list>
        </table>
        
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
        <@components.pagination "/lgsBills/item?billId=${billId!}&batchNub=${batchNub!}&qrcodeBoxId=${qrcodeBoxId!}&qrcodeBottleId=${qrcodeBottleId!}&page=$page",itemList.page,itemList.pageTotal/>
    </div>
</div>

<!--===========Modals start================--->
<div class="modal" id="bot_detail" tabindex="-1">
    <div class="modal-dialog" role="document" style="width:700px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h5 class="modal-title"><i class="fa fa-plus"></i> 查看</h5>
            </div>
            <div class="modal-body">
                <ul>
                    <li id="box" style="list-style: none"></li>
                    <li style="list-style: none"></li>
                    <li id="bottle" style="list-style: none"></li>
                </ul>
            </div>
        </div>
    </div>
</div>


</@layout_default>